﻿<Window x:Class="WowModelExplorer.Controls.M2GeosetsWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:data="clr-namespace:WowModelExplorer.Data"
        Title="{DynamicResource geosetsWindow}"
        Width="350"
        Height="500">
    <Grid Name="_mainGrid">
        <Grid.Resources>
            <data:M2GeosetCollection x:Key="_geosets" />

            <DataTemplate x:Key="CheckCell">
                <StackPanel Orientation="Horizontal">
                    <CheckBox IsChecked="{Binding Path=Visible, Mode=TwoWay}" />
                </StackPanel>
            </DataTemplate>
        </Grid.Resources>
        <ListView Name="_listView"
                  Grid.Row="1"
                  ItemsSource="{Binding Source={StaticResource _geosets},
                                        Mode=OneTime}">
            <ListView.View>
                <GridView>
                    <GridViewColumn Width="60" DisplayMemberBinding="{Binding Path=Index}">
                        <GridViewColumnHeader Click="GridViewColumnHeader_Click"
                                              Content="{DynamicResource index}"
                                              Tag="Index" />
                    </GridViewColumn>
                    <GridViewColumn Width="60" DisplayMemberBinding="{Binding Path=GeoSetID}">
                        <GridViewColumnHeader Click="GridViewColumnHeader_Click"
                                              Content="{DynamicResource id}"
                                              Tag="GeoSetID" />
                    </GridViewColumn>
                    <GridViewColumn Width="60" DisplayMemberBinding="{Binding Path=VCount}">
                        <GridViewColumnHeader Click="GridViewColumnHeader_Click"
                                              Content="{DynamicResource vertexNum}"
                                              Tag="VCount" />
                    </GridViewColumn>
                    <GridViewColumn Width="60" DisplayMemberBinding="{Binding Path=ICount}">
                        <GridViewColumnHeader Click="GridViewColumnHeader_Click"
                                              Content="{DynamicResource indexNum}"
                                              Tag="ICount" />
                    </GridViewColumn>
                    <GridViewColumn Width="50" CellTemplate="{StaticResource CheckCell}">
                        <GridViewColumnHeader Content="{DynamicResource visible}">
                            <GridViewColumnHeader.ContextMenu>
                                <ContextMenu>
                                    <MenuItem Click="VisibleAllSelect_Click" Header="{DynamicResource allSelect}" />
                                    <MenuItem Click="VisibleNoneSelect_Click" Header="{DynamicResource noneSelect}" />
                                </ContextMenu>
                            </GridViewColumnHeader.ContextMenu>
                        </GridViewColumnHeader>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
    </Grid>
</Window>
